<template>
    <div class="file-list-wrapper">
        <!-- 操作按钮 -->
        <el-header>
            <operation-menu></operation-menu>
        </el-header>
        <div class="middle-wrapper">
            <!-- 面包屑导航栏 -->
            <bread-crumb class="breadcrumb"></bread-crumb>
        </div>
        <file-table
                :fileList="fileList"
        ></file-table>
    </div>
</template>

<script>
    import Bus from "@/common/evenBus";
    import OperationMenu from "./OperationMenu";
    import BreadCrumb from "./BreadCrumb";
    import FileTable from "./FileTable";
    import {getFileList} from "../../../../api/api";
    export default {
        name: "FileList",
        components: {FileTable, BreadCrumb, OperationMenu},
        inject:['reload'],
        created(){
            let cc='/'
            cc=this.$route.query.filePath==null?cc: this.$route.query.filePath
            const aa={
                filePath:cc
            }
            getFileList(aa).then(res=>{
                this.fileList = res.data
            })
          //  this.fileList = []
          //   this.pageData.total = demo.data.total
            this.loading = false


        },
        mounted(){
            Bus.$on("refresh",(message)=>{
               //alert(message)
                this.reload()
                // getFileList(message).then(res=>{
                //     this.fileList = res.data
                // })
            });
        },
        data(){
            return{
                loading: true, //  表格数据-loading
                    fileList: [], //  表格数据-文件列表
            }
        }
    }
</script>

<style lang="stylus" scoped>
    @import '~@/assets/styles/varibles.styl'
    .file-list-wrapper
        >>> .el-header
            padding 0
        .middle-wrapper
            margin-bottom 8px
        .pagination-wrapper
            position relative
            border-top 1px solid $BorderBase
            height 44px
            line-height 44px
            text-align center
            .current-page-count
                position absolute
                left 16px
                height 32px
                line-height 32px
                font-size 13px
                color $RegularText
</style>